Repository navigation
Conversation
The package now owns the tool outcome rules and the attachment merge they read, selects the visible sibling through its own atom, and derives the steer path's code approval mode from raw inputs. ChatHost loses getMappingOptions and useSetSiblingIdx; SteerHost.useCodeApprovalMode becomes useCodeApprovalInputs.
The tail of the branch on screen becomes package logic, read through useBranchTail. ChatHost loses useLatestMessage and useLatestMessageId; SteerHost.useLatestMessage becomes the useRouteConversationId adapter.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a713c163ab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| mockTailQueryKeys.push(key[1]); | ||
| const tail = mockLatestMessage == null ? [] : [mockLatestMessage]; | ||
| return { data: select(mockLatestMessage === undefined ? (mockMessages ?? []) : tail) }; |
There was a problem hiding this comment.
Exercise steering with a real React Query cache
The new React Query mock returns the same messages for every query key and bypasses cache subscriptions, so the steering tests cannot detect reading another conversation's messages or failing to update the branch anchor after history hydration. These are important behaviors of the branch-tail integration being changed here. This also violates AGENTS.md's testing requirement to use real logic and mock only external HTTP APIs or uncontrollable services. Use a real QueryClientProvider, seed distinct conversation caches, and update the cache to verify that steering follows the correct branch.
AGENTS.md reference: AGENTS.md:L211-L214
Useful? React with 👍 / 👎.
The steering spec mocked React Query to return one message list for every key, so it could not notice a read of another conversation's cache or a tail that stops following the cache. It now provides a real QueryClient, seeds each conversation key, and covers the route and another chat holding different tails and a cache that hydrates after mount.
Pull Request
Summary
ChatHostandSteerHoststill asked the app for behavior a consumer of@librechat/chatshould not have to supply: how a message's tool outcomes are mapped, which sibling is selected under a parent, which message is the tail of the branch on screen, and which code approval mode a queued turn runs under. This is the next link after #17797: the package now owns each of them and the host keeps only reads of app state.The tool outcome rules and the attachment merge they read move into
core/parts.ChatHostlosesgetMappingOptions,useSetSiblingIdx,useLatestMessageanduseLatestMessageId; the package selects the sibling through its own atom and reads the tail throughuseBranchTail.SteerHost.useCodeApprovalModebecomesuseCodeApprovalInputs, a storage read, and the steer path derives the mode withresolveCodeApprovalModes.SteerHost.useLatestMessagebecomesuseRouteConversationId. Behavior is unchanged.How it works
Type of change
Testing
Tested environments/configuration:
reviewctl verifyAutomated tests:
packages/chat/src/react/__tests__/latest.spec.tsxcovers the default tail, a selected sibling and an absent query iduseSteering.spec.tsxnow feeds raw approval inputs and asserts the queued mode, including the without-attached gate and that the saved conversation id wins over the routenpx jestin packages/chat: 174 suites, 2,601 tests pass; client hooks, utils and chat specs: 123 suites, 2,832 tests pass;npx tsc --noEmitin packages/chat and client: cleanScreenshots / recordings
No user-facing change.
Risk / compatibility
Hosts of the unreleased package lose the four
ChatHostmembers and gain theSteerHostreplacements above. This branch conflicts with current dev in the attachment helpers, which dev moved into the package; it will be rebased once #17797 merges.Checklist